import {getArticleCommentList} from "@/api/system/article";

// 点击谋篇文章的评论列表
const mixin_article = {
  data() {
    return {
      comment_total: 0,
      queryCommentParams: {
        pageNum: 1,
        pageSize: 10
      }
    }
  },
  mounted() {
  },
  methods: {
    //查看文章的评论列表
    checkArticleComments(row) {
      this.articleCommentDialogVisible = true;
      this.currentId = row.articleId
      this.getCommentList({articleId: this.currentId, pageNum: 1, pageSize: 10})
    },
    // 分页
    getCommentList() {
      getArticleCommentList({
        articleId: this.currentId,
        pageNum: this.queryCommentParams.pageNum,
        pageSize: this.queryCommentParams.pageSize
      }).then(res => {
        this.comment_total = res.total;
        this.articleCommentList = res.rows;
      })
    },
  }
}

export default mixin_article;
